package src.dataStructures;

import java.util.ArrayList;
import java.util.List;

/**
 * The user class contains the information on a specific user
 * @author John Stewart
 */
public class User extends Data {
	
	// These are the system controlled variables
	public List<Integer> itemlist = new ArrayList<Integer>();
	
	// These variables are free to edit
	
	public User(int userid, String username) {
		id = userid;
		name = username;
		detail = DetailLevel.EFFICIENT;
	}
	
	/**
	 * Sets up an empty user class
	 */
	public User() {
		detail = DetailLevel.EMPTY;
	}
	
	public Data copyFull(Data data) {
		if (data instanceof User) {
			User user = (User) data;
			user.itemlist = new ArrayList<Integer>();
			if (itemlist != null)
				itemlist.addAll(this.itemlist);
		}
		return super.copyFull(data);
	}

	public Data copy(Data data) {
		if (data instanceof User) {
			User user = (User) data;
			switch (data.detail) {
			case FULL:
			case PUBLIC:
			case BRIEF:
			case EFFICIENT:
			case EMPTY:
			default:
			}
		}
		return super.copy(data);
	}
	
	public String toString() {
		return "User | ID: "+id+" | Name: "+name+" | DetailLevel.FULL? "+(detail==DetailLevel.FULL);
	}
	
}
